package com.jzh.eurekaclient.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class ConfigController {
    @Value("${from}")
    private String from;
    @Value("${eureka.client.registryFetchIntervalSeconds}")
    private String regFetIntSec;

    @RequestMapping(value = "/from" ,method = RequestMethod.GET)
    public String from() {

        return this.from;
    }

    /**
     * 测试本地配置文件和远程配置文件同时存在时，哪个优先级更高
     * @return
     */
    @RequestMapping(value = "/regFetIntSec" ,method = RequestMethod.GET)
    public String regFetIntSec() {

        return this.regFetIntSec;
    }
}
